from rest_framework.serializers import ModelSerializer

from home.models import NavModel, BannerModel, CategoryModel


class NavSer(ModelSerializer):
    class Meta:
        model = NavModel
        fields = "__all__"

class BannerSer(ModelSerializer):
    class Meta:
        model = BannerModel
        fields = "__all__"
class Category(ModelSerializer):
    class Meta:
        model = CategoryModel
        fields = ['id','catename']
class CategorySer(ModelSerializer):
    children = Category(many = True)
    class Meta:
        model = CategoryModel
        fields = "__all__"